﻿// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using PersonalBudgeting.Models;

#nullable disable

namespace PersonalBudgeting.Migrations
{
    [DbContext(typeof(PersonalBudgetingContext))]
    partial class PersonalBudgetingContextModelSnapshot : ModelSnapshot
    {
        protected override void BuildModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("ProductVersion", "7.0.20")
                .HasAnnotation("Relational:MaxIdentifierLength", 63);

            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

            modelBuilder.Entity("PersonalBudgeting.Models.DTO.User", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid");

                    b.Property<string>("Email")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<bool>("IsAgree")
                        .HasColumnType("boolean");

                    b.Property<string>("Login")
                        .IsRequired()
                        .HasMaxLength(50)
                        .HasColumnType("character varying(50)");

                    b.Property<string>("Password")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<string>("Phone")
                        .HasColumnType("text");

                    b.HasKey("Id");

                    b.ToTable("Users");
                });

            modelBuilder.Entity("PersonalBudgeting.Models.Expense", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid");

                    b.Property<decimal>("Amount")
                        .HasColumnType("numeric");

                    b.Property<DateTime>("Date")
                        .HasColumnType("timestamp with time zone");

                    b.Property<Guid?>("ExpensesCategoryId")
                        .HasColumnType("uuid");

                    b.Property<string>("Name")
                        .HasColumnType("text");

                    b.Property<Guid?>("UserId")
                        .HasColumnType("uuid");

                    b.HasKey("Id");

                    b.HasIndex("ExpensesCategoryId");

                    b.HasIndex("UserId");

                    b.ToTable("Expenses");
                });

            modelBuilder.Entity("PersonalBudgeting.Models.ExpensesCategory", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid");

                    b.Property<string>("Name")
                        .HasColumnType("text");

                    b.HasKey("Id");

                    b.ToTable("ExpensesCategories");
                });

            modelBuilder.Entity("PersonalBudgeting.Models.Income", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid");

                    b.Property<decimal>("Amount")
                        .HasColumnType("numeric");

                    b.Property<DateTime?>("Date")
                        .HasColumnType("timestamp with time zone");

                    b.Property<Guid?>("IncomesCategoryId")
                        .HasColumnType("uuid");

                    b.Property<bool>("IsRealized")
                        .HasColumnType("boolean");

                    b.Property<string>("Name")
                        .HasColumnType("text");

                    b.Property<Guid?>("UserId")
                        .HasColumnType("uuid");

                    b.HasKey("Id");

                    b.HasIndex("IncomesCategoryId");

                    b.HasIndex("UserId");

                    b.ToTable("Incomes");
                });

            modelBuilder.Entity("PersonalBudgeting.Models.IncomesCategory", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid");

                    b.Property<string>("Name")
                        .HasColumnType("text");

                    b.HasKey("Id");

                    b.ToTable("IncomesCategories");
                });

            modelBuilder.Entity("PersonalBudgeting.Models.MandatoryExpense", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid");

                    b.Property<decimal>("Amount")
                        .HasColumnType("numeric");

                    b.Property<DateTime?>("Date")
                        .HasColumnType("timestamp with time zone");

                    b.Property<bool>("IsRealized")
                        .HasColumnType("boolean");

                    b.Property<Guid?>("MandatoryExpensesCategoryId")
                        .HasColumnType("uuid");

                    b.Property<string>("Name")
                        .HasColumnType("text");

                    b.Property<Guid?>("UserId")
                        .HasColumnType("uuid");

                    b.HasKey("Id");

                    b.HasIndex("MandatoryExpensesCategoryId");

                    b.HasIndex("UserId");

                    b.ToTable("MandatoryExpenses");
                });

            modelBuilder.Entity("PersonalBudgeting.Models.MandatoryExpensesCategory", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid");

                    b.Property<string>("Name")
                        .HasColumnType("text");

                    b.HasKey("Id");

                    b.ToTable("MandatoryExpensesCategories");
                });

            modelBuilder.Entity("PersonalBudgeting.Models.Expense", b =>
                {
                    b.HasOne("PersonalBudgeting.Models.ExpensesCategory", "ExpensesCategory")
                        .WithMany()
                        .HasForeignKey("ExpensesCategoryId");

                    b.HasOne("PersonalBudgeting.Models.DTO.User", "User")
                        .WithMany()
                        .HasForeignKey("UserId");

                    b.Navigation("ExpensesCategory");

                    b.Navigation("User");
                });

            modelBuilder.Entity("PersonalBudgeting.Models.Income", b =>
                {
                    b.HasOne("PersonalBudgeting.Models.IncomesCategory", "IncomesCategory")
                        .WithMany()
                        .HasForeignKey("IncomesCategoryId");

                    b.HasOne("PersonalBudgeting.Models.DTO.User", "User")
                        .WithMany()
                        .HasForeignKey("UserId");

                    b.Navigation("IncomesCategory");

                    b.Navigation("User");
                });

            modelBuilder.Entity("PersonalBudgeting.Models.MandatoryExpense", b =>
                {
                    b.HasOne("PersonalBudgeting.Models.MandatoryExpensesCategory", "MandatoryExpensesCategory")
                        .WithMany()
                        .HasForeignKey("MandatoryExpensesCategoryId");

                    b.HasOne("PersonalBudgeting.Models.DTO.User", "User")
                        .WithMany()
                        .HasForeignKey("UserId");

                    b.Navigation("MandatoryExpensesCategory");

                    b.Navigation("User");
                });
#pragma warning restore 612, 618
        }
    }
}
